//package com.gpframework.module.controller.order;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//
//import java.util.ArrayList;
//import java.util.Iterator;
//import java.util.List;
//import java.util.Arrays;
//import cn.hutool.core.convert.Convert;
//import cn.hutool.core.lang.TypeReference;
//import com.gpframework.common.exception.ParamException;
//import com.gpframework.common.utils.StringUtils;
//import lombok.RequiredArgsConstructor;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.PutMapping;
//import org.springframework.web.bind.annotation.DeleteMapping;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//import com.gpframework.common.annotation.Log;
//import com.gpframework.common.core.controller.BaseController;
//import com.gpframework.common.core.domain.AjaxResult;
//import com.gpframework.common.enums.BusinessType;
//import com.gpframework.module.order.domain.GpProduct;
//import com.gpframework.module.order.domain.vo.GpProductVo;
//import com.gpframework.module.order.domain.req.GpProductReq;
//import com.gpframework.module.order.domain.req.GpProductAdd;
//import com.gpframework.module.order.domain.req.GpProductUpdate;
//import com.gpframework.module.order.service.IGpProductService;
//import com.gpframework.common.utils.poi.ExcelUtil;
//import javax.validation.Valid;
//import io.swagger.annotations.*;
//import com.gpframework.common.core.page.TableDataInfo;
///**
// * @ClassName GpProductController
// * @Author gpframework
// * @Date 2023-06-16
// * @Version 1.0.0
// * @Description 产品Controller 接口类
// */
//@Validated
//@Api(tags = "产品")
//@RequiredArgsConstructor(onConstructor_ = @Autowired)
//@RestController
//@RequestMapping("/order/product" )
//public class GpProductController extends BaseController {
//
//    private final IGpProductService iGpProductService;
//
// /**
//  * @Description 分页
//  * @Author gpframework
//  * @Date 2023-06-16
//  * @Param gpProduct
//  * @Return TableDataInfo
// */
//    @ApiOperation("列表")
//    @GetMapping("/list")
//    public TableDataInfo<GpProductVo> list(GpProductReq gpProductReq)
//    {
//        startPage();
//        QueryWrapper<GpProduct> lqw = new QueryWrapper<GpProduct>();
//        gpProductReq.generatorQuery(lqw,true);
//        List<GpProductVo> list = iGpProductService.listVo(lqw);
//        return getDataTable(list);
//    }
//
//    /**
//     * @Description 详情
//     * @Author gpframework
//     * @Date 2023-06-16
//     * @Param gpProduct
//     * @Return AjaxResult
//     */
//    @ApiOperation("详情")
//    @GetMapping(value = "/{id}" )
//    public AjaxResult<GpProductVo> getInfo(@PathVariable("id" ) Long id) {
//        return AjaxResult.success(iGpProductService.getVoById(id));
//    }
//
//    /**
//     * @Description 新增
//     * @Author gpframework
//     * @Date 2023-06-16
//     * @Param gpProduct
//     * @Return AjaxResult
//     */
//    @ApiOperation("新增")
//    @PostMapping
//    public AjaxResult add(@Valid @RequestBody GpProductAdd gpProductAdd) {
//        GpProduct gpProduct = Convert.convert(new TypeReference<GpProduct>() {}, gpProductAdd);
//        return toAjax(iGpProductService.save(gpProduct) ? 1 : 0);
//    }
//
//    /**
//     * @Description 修改
//     * @Author gpframework
//     * @Date 2023-06-16
//     * @Param gpProduct
//     * @Return AjaxResult
//     */
//    @ApiOperation("修改")
//    @PutMapping
//    public AjaxResult edit(@Valid @RequestBody GpProductUpdate gpProductUpdate) {
//        GpProduct gpProduct = Convert.convert(new TypeReference<GpProduct>() {}, gpProductUpdate);
//        return toAjax(iGpProductService.updateById(gpProduct) ? 1 : 0);
//    }
//
//    /**
//     * @Description 删除
//     * @Author gpframework
//     * @Date 2023-06-16
//     * @Param gpProduct
//     * @Return AjaxResult
//     */
//    @ApiOperation("删除")
//    @DeleteMapping("/{ids}" )
//    public AjaxResult remove(@PathVariable Long[] ids) {
//        return toAjax(iGpProductService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
//    }
//}
